<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%String path = request.getContextPath();%>
<c:forEach items="${requestScope.delivers}" var="deliver">
    <ul class="reset resumeLists">
        <li data-id="1686182" class="onlineResume">

            <div class="resumeShow">
                <a title="预览在线简历" target="_blank" class="resumeImg"
                   href="resumeView.html?deliverId=1686182">
                    <img src="/static/uploadImg/${deliver.resume.userinfo.headImage}">
                </a>
                <div class="resumeIntro">
                    <h3 class="unread">
                        <a target="_blank" title="预览jason的简历"
                           href="${pageContext.request.contextPath}/zhuang/company/preview?userId=${deliver.resume.id}&deliverId=${deliver.id}&state=${deliver.state}">
                                ${deliver.resume.name}
                        </a>
                        <em></em>
                    </h3>
                    <span class="fr"><fmt:formatDate value="${deliver.inputTime}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
                    <div>
                            ${deliver.resume.name} / ${deliver.resume.userinfo.sex} / ${deliver.resume.education.degree.title} / ${deliver.resume.exRequire.require} / ${deliver.resume.city.cityName} <br>
                            ${deliver.resume.workEx.jobName} · ${deliver.resume.workEx.companyName} | ${deliver.resume.education.degree.title} · ${deliver.resume.education.school}
                    </div>
                    <div class="jdpublisher">
				                                        <span>
				                                        	应聘职位：<a title="随便写" target="_blank"
                                                                    href="http://www.lagou.com/jobs/149594.html">${deliver.job.name}</a>
				                                       						                                        </span>
                    </div>
                </div>
                <div class="links">
                    <a data-deliverid="1686182" data-name="jason" data-positionid="149594"
                       data-email="888888888@qq.com" class="resume_notice"
                       href="javascript:void(0)" data-uid="${deliver.resume.userinfo.id}" data-id="${deliver.id}" data-stat="${deliver.resumeState.id}">通知面试</a>
                    <a data-deliverid="1686182" class="resume_refuse" href="javascript:void(0)" data-uid="${deliver.resume.userinfo.id}" data-id="${deliver.id}" data-stat="${deliver.resumeState.id}">不合适</a>
                </div>
            </div>
            <div class="contactInfo">
                <span class="c9">电话：</span>${deliver.resume.userinfo.telephone} &nbsp;&nbsp;&nbsp;
                <span class="c9">邮箱：</span><a href="mailto:888888888@qq.com">${deliver.resume.userinfo.email}</a>
            </div>
        </li>
    </ul>
</c:forEach><!-- end .resumeLists -->
<div class="Pagination">
    ${requestScope.pageInfo.total}条
    ${requestScope.pageInfo.pages}页
    <a href="#" data-pagenum="1">首页 </a>

    <c:if test="${requestScope.pageInfo.pageNum gt 1}">
        <a href="#" data-pagenum="${requestScope.pageInfo.pageNum-1}">上一页</a>
    </c:if>


    <c:forEach begin="1" end="${requestScope.pageInfo.pages}" var="i">

        <a href="#" data-pagenum="${i}"
                <c:if test="${i eq requestScope.pageInfo.pageNum}"> class="current" </c:if>>${i}</a>
    </c:forEach>


    <c:if test="${requestScope.pageInfo.pageNum lt requestScope.pageInfo.pages}">
        <a href="#" data-pagenum="${requestScope.pageInfo.pageNum+1}">下一页</a>
    </c:if>
    <a href="#" data-pagenum="${requestScope.pageInfo.pages}">尾页 </a>
    ${requestScope.pageInfo.pageNum}/${requestScope.pageInfo.pages}页
</div>
<script>
    var path = "${pageContext.request.contextPath}";
    $(function () {
        $(".resume_refuse").click(function () {
            var id = $(this).data("id");
            var stat = $(this).data("stat");
            var userId = $(this).data("uid");
            var ansswer = confirm("是否确认为不合适？");
            if (ansswer)
            {
                $.get(path+"/zhuang/company/inappropriate",
                    {id:id,stat:stat,userId:userId},
                    function (msg) {
                        if (msg!=0) {
                            $(this).parent().parent().parent().remove();
                        }
                        else {
                            alert("您还未查看简历！")
                        }
                    }.bind(this));
            }
            else {
                return false;
            }
        });
    });
</script>
<script>
    var path = "${pageContext.request.contextPath}";
    $(function () {

        $(".resume_notice").click(function () {
            var ansswer = confirm("通知面试将会想用户邮箱发送面试邮件，是否确认通过？");
            var id = $(this).data("id");
            var stat = $(this).data("stat");
            var userId = $(this).data("uid");
            if (ansswer)
            {
                $.get(
                    path+"/zhuang/company/adopt",
                    {id:id,stat:stat,userId:userId},
                    function (msg)
                    {
                        if (msg!=0)
                        {
                            $(this).parent().parent().parent().remove();
                        }
                        else
                        {
                            alert("您还未查看简历！");
                        }
                    }.bind(this));
            }
            else
            {
                return false;
            }

        });
    });
</script>